1. ACTIVE RFID
2. PASSIVE RFID
/* Name : main.c
* Purpose : Source code for RFID Interfacing with Arduino.
* Author : Gemicates
* Date : 22-01-2018
* Website : www.gemicates.org
* Revision : None
*/
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
// initialize the library with the numbers of the interface pins
SoftwareSerial RFID(0, 1);
LiquidCrystal lcd(4, 5, 6, 7, 8, 9, 10, 11, 12, 13); //RS, EN, D1, D2, D3, D4,D5,D6,D7
void setup()
{
RFID.begin(9600); //RFID communication enabling by 9600 baud rate
lcd.begin(16, 2); // set up the LCD's number of columns and rows
}
void loop()
{
int index =0 ; //integer for storing character of ID
char unit;
String msg; //memory for storing the characters of ID
//while no card is in field of action
if(msg==0)
{
lcd.setCursor(0,0); //move courser to first line
lcd.print(" TAG is not in "); //prints that sentence
lcd.setCursor(0,1); //move courser to second line
lcd.print("field of action "); //prints that sentence
}
while(RFID.available()>0)
{
//when card is in field
lcd.setCursor(0,0); //move courser to first line
lcd.print("TAG ID number is"); //prints that sentence
lcd.setCursor(0,1); //move courser to second line
lcd.print(" "); //prints 12 characters on LCD
//clearing previos data
unit = RFID.read(); //storing 12 characters one by one
index++;
msg += unit;
if(index == 12)
{
lcd.setCursor(0,1);
lcd.print(msg);
break;
}
}
msg=""; //clearing msg container
delay(1000); //giving delay for persistence of vision
}